package com.tksflysun.im.common.result;

public class ControllerResult {

    public final static String SUCCESS = "000001";
    public final static String ERROR = "000002";
    /**
     * 用户未登录
     */
    public final static String NO_LOGIN = "000003";
    /**
     * 不具有权限
     */
    public final static String NO_AUTHORITY = "000005";
    /**
     * 登录失败
     */
    public final static String LOGIN_FAIL = "000006";
    /**
     * 微信登录失败
     */
    public final static String WEIXIN_LOGIN_FAIL = "000007";
    /**
     * excel导出错误
     */
    public final static String EXCEL_IMPORT_ERROR = "000008";
    public final static String USER_CANNOT_INSERT = "000009";

    /**
     * 提醒记录次数限制
     */
    public final static String REMIND_COUNT_LIMIT = "000010";

    /**
     * 验证码过期
     */
    public final static String VERIFY_CODE_OUT = "000011";
    public final static String SUCCESS_STR = "success";
    public final static String ERROR_STR = "error";
    public final static String PARAMETER_NULL = "parameter is null";

    private String code;
    private String msg;
    private Object data;

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    public Object getData() {
        return data;
    }

    public void setData(Object data) {
        this.data = data;
    }

    public static ControllerResult getSuccessResult() {
        return new ControllerResult(ControllerResult.SUCCESS);
    }

    public static ControllerResult getSuccessResult(String msg) {
        return new ControllerResult(ControllerResult.SUCCESS, msg);
    }

    public static ControllerResult getErrorResult() {
        return new ControllerResult(ControllerResult.ERROR);
    }

    public static ControllerResult getErrorResult(String msg) {
        return new ControllerResult(ControllerResult.ERROR, msg);
    }

    public ControllerResult(String code) {
        super();
        this.code = code;
    }

    public ControllerResult(String code, String msg, Object data) {
        super();
        this.code = code;
        this.msg = msg;
        this.data = data;
    }

    public static ControllerResult getResult(String code, String msg, Object data) {
        return new ControllerResult(code, msg, data);
    }

    public static ControllerResult getResult(String code, String msg) {
        return new ControllerResult(code, msg);
    }

    public ControllerResult(String code, String msg) {
        super();
        this.code = code;
        this.msg = msg;
    }

    public ControllerResult() {
        super();
    }
}
